package com.guazi.trackingtest.cal.data;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public class Point3D {
    public double x;
    public double y;
    public double z;

    public Point3D(Point3D newPoint3D) {
        this.x = newPoint3D.x;
        this.y = newPoint3D.y;
        this.z = newPoint3D.z;
    }

    public Point3D add(Point3D point3D) {
        this.x += point3D.x;
        this.y += point3D.y;
        this.z += point3D.z;
        return this;
    }

    public void setPoint(double x, double y, double z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public void setPoint(Point3D point3D) {
        this.x = point3D.x;
        this.y = point3D.y;
        this.z = point3D.z;
    }

    public Point3D subtract(Point3D point3D) {
        this.x -= point3D.x;
        this.y -= point3D.y;
        this.z -= point3D.z;
        return this;
    }
}
